home *** CD-ROM | disk | FTP | other *** search
/ QuickTime - The Beta Release / QuickTime - The Beta Release.iso / Programming Stuff / Sample Code / Example Compressor / examplecodec.r < prev   
Text File  |  1991-09-05  |  3KB  |  116 lines

  1.  
  2. #include "Types.r"
  3. #include "MPWTypes.r"
  4. #include "Image Codec.r"
  5.  
  6.  
  7. #define    exampleCodecFormatName            "Example - YUV"
  8.  
  9.  
  10. #define    exampleCodecFormatType    'exmp'
  11.  
  12.  
  13. /*
  14.  
  15.     This structure defines the capabilities of the codec. There will 
  16.     probably be a tool for creating this resource, which measures the performance
  17.     and capabilities of your codec.
  18.     
  19. */
  20. resource 'cdci' (128, "Example CodecInfo",locked) {
  21.     exampleCodecFormatName,                            /* name of the codec TYPE ( data format ) */
  22.     1,                                                /* version */                            
  23.     1,                                                /* revision */    
  24.     'appl',                                            /* who made this codec */
  25.     codecInfoDoes32,                                /* depth and etc. supported directly on decompress */    
  26.     codecInfoDoes32,                                /* depth and etc supported directly on compress */
  27.     codecInfoDepth16,                                /* which data formats do we understand */
  28.     100,                                            /* compress accuracy (0-255) (relative to format) */
  29.     100,                                            /* decompress accuracy (0-255) (relative to format) */
  30.     200,                                            /* millisecs to compress 320x240 image on base Mac */
  31.     200,                                            /* millisecs to decompress 320x240 image on base Mac */
  32.     100,                                            /* compression level (0-255) (relative to format) */
  33.     0,                                
  34.     2,                                                /* minimum height */
  35.     2,                                                /* minimum width */
  36.     0,
  37.     0,
  38.     0
  39. };
  40.  
  41.  
  42.  
  43. resource 'thng' (128,  "Example Compressor",locked) {
  44.     compressorComponentType,
  45.     exampleCodecFormatType,
  46.     'appl',
  47.     codecInfoDoes32,
  48.     0,
  49.     'cdec',
  50.     128,
  51.     'STR ',
  52.     128,
  53.     'STR ',
  54.     129,
  55.     'ICON',
  56.     128
  57. };
  58.  
  59. resource 'thng' (130,  "Example Decompressor",locked) {
  60.     decompressorComponentType,
  61.     exampleCodecFormatType,
  62.     'appl',
  63.     codecInfoDoes32,
  64.     0,
  65.     'cdec',
  66.     128,
  67.     'STR ',
  68.     130,
  69.     'STR ',
  70.     131,
  71.     'ICON',
  72.     130
  73. };
  74.  
  75.  
  76. resource 'ICON' (128, purgeable) {
  77.     $"0003 8000 0004 C000 0004 C000 0004 C000"
  78.     $"0004 C000 0004 C000 0004 C000 0004 C000"
  79.     $"0004 C000 0004 C000 0004 C000 0004 C000"
  80.     $"0004 C000 0004 C000 0004 C000 0004 C000"
  81.     $"0004 C000 0004 C000 0004 C000 0007 C000"
  82.     $"0008 6000 0018 7000 007F FC00 00C0 1E00"
  83.     $"0180 1F00 0100 0F00 0100 0F00 0300 0F80"
  84.     $"0200 0F80 03FF FF80 0C00 0FE0 0FFF FFE0"
  85. };
  86.  
  87. resource 'STR ' (128) {
  88.     "My Example Compressor"
  89. };
  90.  
  91. resource 'STR ' (129) {
  92.     "Compresses (in an exemplar fasion) an image into a YUVish format."
  93. };
  94.  
  95.  
  96. resource 'ICON' (130, purgeable) {
  97.     $"0200 0F80 03FF FF80 0C00 0FE0 0FFF FFE0"
  98.     $"0180 1F00 0100 0F00 0100 0F00 0300 0F80"
  99.     $"0008 6000 0018 7000 007F FC00 00C0 1E00"
  100.     $"0004 C000 0004 C000 0004 C000 0007 C000"
  101.     $"0004 C000 0004 C000 0004 C000 0004 C000"
  102.     $"0004 C000 0004 C000 0004 C000 0004 C000"
  103.     $"0004 C000 0004 C000 0004 C000 0004 C000"
  104.     $"0003 8000 0004 C000 0004 C000 0004 C000"
  105. };
  106.  
  107. resource 'STR ' (130) {
  108.     "My Example Decompressor"
  109. };
  110.  
  111. resource 'STR ' (131) {
  112.     "Decompresses an image conmpressed in YUVish format."
  113. };
  114.  
  115.  
  116.